<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common-app/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>项目工作进度查询</title>
<script type="text/javascript" src="${res}/js/public.js"></script>
<script type="text/javascript" src="${res}/js/proposal/irisPrpPrepare.js"></script>
<script type="text/javascript" src="${res_app}/js/app/proposal/irisPrpPrepare.js"></script>
<link href="${res}/css/progress-pop.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
function showProgress(obj){
	var classname=$(obj).attr("class");
	var id=$(obj).parent().next().find("li:eq(0)").attr("id");
	id=id.replace("progress_code_","");
	var progressCode='${progressCode}';
	if(classname=='icon_close'){
		$(obj).parent().next().find("li:gt(0)").hide(500);
		$(obj).attr("class", "icon_open"); 
	}else if(classname=='icon_open'){
		$(obj).parent().next().find("li:gt(0)").show(500);
		$(obj).attr("class", "icon_close");
		if(progressCode=='1009'){
			$(obj).parent().next().find("li[id='progress_code_1008']").css("display","none");
			$("#progress_code_1006").css("display","none");
			$("#progress_code_1007").css("display","none");
		}else{
			$(obj).parent().next().find("li[id='progress_code_1009']").css("display","none");
		}
	}
}
function showProgressBig(obj){
	var objI=$(obj).parent().parent().prev().find("i");
	var classname=objI.attr("class");
	var id=$(obj).attr("id");
	id=id.replace("progress_code_","");
	var progressCode='${progressCode}';
	if(classname=='icon_close'){
		objI.parent().next().find("li:gt(0)").hide(500);
		objI.attr("class", "icon_open"); 
	}else if(classname=='icon_open'){
		objI.parent().next().find("li:gt(0)").show(500);
		objI.attr("class", "icon_close"); 
		if(progressCode=='1009'){
			objI.parent().next().find("li[id='progress_code_1008']").css("display","none");
			$("#progress_code_1006").css("display","none");
			$("#progress_code_1007").css("display","none");
		}else{
			objI.parent().next().find("li[id='progress_code_1009']").css("display","none");
		}
	}
}
function showInfo(obj){
	var div=$(obj).parent().find("div[class='two_pop']");
	var divObj=div.css("display");
	if(divObj=='none'){
		$("dl").find("li").each(function(){
			$(this).find("div[class='two_pop']").hide(500);
		}); 
		div.show(500);
	}else{
		div.hide(500);
	}
	
}

$(function(){
	//$("span[onclick='showInfo(this);']").;
});
/**
 * 查看申请书审核意见
 * 
 */
	function viewComment(des3Prpcode){
		var url="${ctx}/proposal/view/audit-comment-view?posCode="+des3Prpcode+"&TB_iframe=true&height=390&width=600";
		var title="审核意见";
		showThickBox(url,title);	
	}
</script>
</head>
<body><input type="hidden" id="childDiv" class="thickbox" />
        	<div class="schedule_query">
        
            		<dl>
            					<dt></dt>
                            <dd class="gray_line wz_gray" >
                            			
                            	<ol>
                                	<li id="progress_code_0000"><i class="big_graycircle"></i><strong>开始</strong></li>
                                </ol>
                            </dd>
                  </dl>
                  <c:forEach items="${progressAll }" var="vo">
                  <dl>
            				<dt><i class="icon_close" onclick="showProgress(this);"></i></dt>
                            <dd class="gray_line wz_gray" >
                            	<ol>
                                	<li id="progress_code_${vo.progressCode }" onclick="showProgressBig(this)" style="cursor:pointer"><i class="big_graycircle" ></i><strong  >${vo.statusName }</strong></li>
                                	<c:forEach items="${vo.subProgressList }" var="vo1">
                                	
                                	<li id="progress_code_${vo1.progressCode }" ><i class="small_graycircle "  onclick="showInfo(this);"></i><span onclick="showInfo(this);">${vo1.createDate }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;<span   onclick="showInfo(this);">${vo1.statusName }</span>
                                		<c:forEach  items="${progressHtml }" var ="vo2"><c:if test="${vo2.progressCode==vo1.progressCode}">${vo2.html }</c:if></c:forEach>
                                	</li>
                                	
                                	</c:forEach>
                                	
                                </ol>
                                
                            </dd>
                  </dl>
                  </c:forEach>		
                    
</div>
	<div class="clear_h15"></div>
	<div align="center">
		<input type="button" class="button_02" value="关闭" id="button01"
			onclick="parent.tb_remove();">
	</div>
<script type="text/javascript">
$(function(){
	$("div[class='two_pop']").each(function(){
		$(this).parent().css("cursor","pointer");
	});
});
$(document).ready(function() {
	var targetProgressCode='${progressCode}';
	var targetStageCode=targetProgressCode.substring(0, 3)+"0";
	 var progressInfoList=eval("("+'${progressInfoList}'+")");
	for(var n=0;n<progressInfoList.length;n++){
		var progressCode=progressInfoList[n].progressCode;
		$("dl").find("li").each(function(){
			var id=$(this).attr("id");
			id=id.replace("progress_code_","");
			var stageCode=id.substring(1, 4);
			var stageCode1=id.substring(0, 3)+"0";
			var dd=$(this).parent().parent();
			if(stageCode1<targetStageCode){
				if(stageCode=="000"){
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("big_graycircle");
				}else{
					$(this).css("display","none");
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("small_graycircle");
					//$(this).find("span:eq(0)").text("跳过");
				}
				dd.removeAttr("class");
				dd.addClass("wz_gray");
				dd.addClass("gray_line");
				dd.prev().find("i").removeAttr("class");
				dd.prev().find("i").addClass("icon_open");
			}else if(stageCode1>targetStageCode){
				if(stageCode=="000"){
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("big_graycircle");
				}else{
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("small_graycircle");
				}
				dd.removeAttr("class");
				dd.addClass("gray_line");
				dd.prev().find("i").removeAttr("class");
				dd.prev().find("i").addClass("icon_close");
			}else{
				if(stageCode=="000"){
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("big_orangecircle");
				}else{
					$(this).find("i").removeAttr("class");
					$(this).find("i").addClass("small_orangecircle");
				}
				dd.removeAttr("class");
				dd.addClass("orange_line");
				dd.prev().find("i").removeAttr("class");
				dd.prev().find("i").addClass("icon_close");
				if(targetProgressCode==id){
					$(this).find("div").css("display","");
					$(this).find("span:eq(0)").css("color","#f58b0f");
					$(this).find("span:eq(1)").css("color","#f58b0f");
				}
				
			}
		}); 
	}
	//当前进度为不同意申报
	if(targetProgressCode=='1009'){
		$("#progress_code_1008").css("display","none");
		$("#progress_code_1006").css("display","none");
		$("#progress_code_1007").css("display","none");
		$("#progress_code_1009").css("display","");
	}else {
		$("#progress_code_1009").css("display","none");
	}
});
</script>
</body>
</html>